<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>用户登录</title>
<link href="../Public/css/login.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">  
//重载验证码  
function freshVerify() {  
  document.getElementById('verifyImg').src='__URL__/verify/'+Math.random();  
}  
function verifyCheck() {
	var username=document.getElementById('username');
    if (username.value.length==0) {
       window.alert("用户名不能为空！");
       username.focus();
       return false;
    }
    for (var i=0;i<username.value.length;i++) {
       var lowerCase=username.value.toLowerCase().charAt(i); 
       if ((!(lowerCase>='0' && lowerCase<='9')) && (!(lowerCase>='a' && lowerCase <='z')))
       {     window.alert("用户名只能由字母和数字组成！");
           username.select();
           return false;
       }
    }
    
    var password=document.getElementById('password');
    if (password.value.length==0) {
       window.alert("密码不能为空！");
       password.focus();
       return false;
    }
    if (password.value.length<6||password.value.length>12) {
       window.alert("请确认密码长度在6-12位之间！");
       password.select();
       return false;
    }
    
    var verify=document.getElementById('verify');
    if(verify.value==''){
    	alert("验证码不能为空!");
    	verify.focus();
    	return false;
    }
    return true;
}
</script>  
</head>
<body>

    <div id="login">
	
	     <div id="top">
		      <div id="top_left"><img src="../Public/images/login/login_03.gif" /></div>
			  <div id="top_center"></div>
		 </div>
		 
		 <div id="center">
		 <form method='post' action='__URL__/login' onsubmit='return verifyCheck();' >
		      <div id="center_left"></div>
			  <div id="center_middle">
			       <div id="user">用户名:
			         <input type="text" name="username" id="username"/>
			       </div>
				   <div id="pwd">密&nbsp;&nbsp;码:
				     <input type="password" name="password" id="password" />
				   </div>
				   <div id="code">验证码:
				     <input type='text' name="verifyDisplay" id="verify" maxlength="4" style ="width:60px"/>  
                     	<img style='cursor:pointer' title='刷新验证码' src='__URL__/verify' id='verifyImg' onclick='freshVerify()'/>  
				   </div>
				   <div id="btn">
				    	<input type="submit" name='sub' value="登录" class="submit"/>
				   </div>
			  </div>
		</form>	  
			  <div id="center_right"></div>		 
		 </div>
		 <div id="down">
		      <div id="down_left">
			      <div id="inf">
                       <span class="inf_type">版本信息</span>
					   <span class="inf_text">六尚网站后台管理信息系统 2012 v1.0</span>
			      </div>
			      <div id="copyright">
			      	   <br/>Copyright &copy; 2012 <b>栊泉工作室</b>  services. All Rights Reserved.
			      </div>
			  </div>
			  <div id="down_center"></div>		 
		 </div>

	</div>
</body>
</html>